package com.ymttest.database.sqlwapper.shenqisettlement;

import java.util.List;

import com.ymt.database.SqlManager;

import com.ymttest.database.model.shenqisettlement.ProxyFissionConfig;

public class ProxyFissionConfigWrapper {

	SqlManager manager;

	public ProxyFissionConfigWrapper() {
		manager = new SqlManager("shenqisettlement");
	}

	@SuppressWarnings("unchecked")
	public ProxyFissionConfig selectByPrimaryKey(long id) {

		ProxyFissionConfig proxyFissionConfig = new ProxyFissionConfig();
		List<ProxyFissionConfig> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.shenqisettlement.ProxyFissionConfigMapper.selectByPrimaryKey",
						id);
		manager.commit();

		if (result.size() > 0) {
			proxyFissionConfig = result.get(0);
		}

		return proxyFissionConfig;
	}
	
	@SuppressWarnings("unchecked")
	public ProxyFissionConfig selectLatestByMerchantId(Long merchantId) {

		ProxyFissionConfig proxyFissionConfig = null;
		List<ProxyFissionConfig> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.shenqisettlement.ProxyFissionConfigMapper.selectLatestByMerchantId",
						merchantId);
		manager.commit();

		if (result.size() > 0) {
			proxyFissionConfig = result.get(0);
		}

		return proxyFissionConfig;
	}
	
	public static void main(String[] args) {
		
		ProxyFissionConfigWrapper wrapper = new ProxyFissionConfigWrapper();
		
		System.out.println(wrapper.selectLatestByMerchantId(50055221234L).getId());
	}
}
